import React from 'react'
import {Button} from 'antd-mobile'
import {connect}  from 'react-redux'
export interface UserProps{
  history:any,
  [ppp:string]:any
}
function User(props:UserProps){
  console.log(props)
  const goLogin = ()=>{
    props.history.push('/login')
  }
  let userName = props.userInfo.userName
  return <>
    我的页面
    {
    userName ? <h1>{userName}</h1>:<Button onClick={goLogin}>登录</Button>
    }
    
  </>
}
export default connect((state)=>{
  return {
    ...state
  }
})(User)